package com.qst.crop.demo.service;

import com.qst.crop.demo.entity.Knowledge;
import com.qst.crop.demo.entity.Product;
import com.qst.crop.demo.mapper.KnowMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KnowService {
    @Autowired
    KnowMapper knowMapper;

    public Integer add(Knowledge knowledge){
        return knowMapper.add(knowledge);
    }

    public List<Knowledge> select(String searchWord){
        return knowMapper.select(searchWord);
    }

    public List<Knowledge> selectAll(){
        return knowMapper.selectAll();
    }

    public Integer update(Knowledge knowledge) {
        return knowMapper.update(knowledge);
    }

    public Integer delete(Knowledge knowledge){
        return knowMapper.delete(knowledge);
    }

    public Knowledge getKnowById(Long knowledgeId){
        return knowMapper.getKnowById(knowledgeId);
    }
}
